package com.etogc.groupchat.group.adpt;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.etogc.groupchat.R;
import com.etogc.groupchat.bean.AllGroupBean;
import com.etogc.util.GcUrl;
import com.etogc.util.ImageUtils;

import java.util.List;

public class AllGroupAdapter extends BaseQuickAdapter<AllGroupBean.AllGroup, BaseViewHolder> {


    public AllGroupAdapter(int layoutResId, @Nullable List<AllGroupBean.AllGroup> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AllGroupBean.AllGroup item) {

        helper.setText(R.id.tvGroupName, item.getGroup_name());
        helper.setText(R.id.tvGroupIntro, item.getRemark());

        ImageView photo = helper.getView(R.id.ivGroupHead);
        ImageUtils.setRadiuImage(mContext, ImageUtils.getImageUrl(item.getPhoto()), photo);
    }
}
